package com.zhht.htzx.ui;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.kunminx.architecture.ui.page.DataBindingConfig;
import com.nsgf.library.ui.page.BaseActivity;
import com.nsgf.library.ui.page.LoginActivity;
import com.nsgf.library.ui.page.StateHolder;
import com.zhht.htzx.BR;
import com.zhht.htzx.R;

public class LoginTypeActivity extends BaseActivity {

    private StateHolder mStates;

    @Override
    protected void initViewModel() {
        mStates = getActivityScopeViewModel(StateHolder.class);
    }

    @Override
    protected DataBindingConfig getDataBindingConfig() {
        return new DataBindingConfig(R.layout.activity_login_type, BR.vm, mStates)
                .addBindingParam(BR.click, new ClickProxy());
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mStates.titleBar.set("角色选择");
    }

    public class ClickProxy {

        public void loginBusiness() {
            startActivity(new Intent().setClass(LoginTypeActivity.this, LoginBusinessActivity.class));
            finish();
        }

        public void loginUser() {
            startActivity(new Intent().setClass(LoginTypeActivity.this, LoginActivity.class));
            finish();
        }

    }


}
